home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group97a.txt
/
000118_icon-group-sender _Wed Apr 16 00:13:55 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
1KB
Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Wed, 16 Apr 1997 16:57:00 MST
Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM)
id AA02428; Wed, 16 Apr 1997 16:57:00 -0700
Date: Wed, 16 Apr 1997 00:13:55 GMT
From: ia@stryx.demon.co.uk (Iain Alexander)
Reply-To: ia@stryx.demon.co.uk
Message-Id: <19729@stryx.demon.co.uk>
To: icon-group@cs.arizona.edu
Subject: Re: Records in Icon
X-Mailer: PCElm 1.10
Lines: 27
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 815
A further thought:
In message <334E5509.2A4@gemini.edu> Steve Wampler writes:
> Do you care why the two records 'match'? That is, do you need to
> distinguish between your two example cases, or is it sufficient to
> simply say "the records 'match'"?
>
> Here's a procedure that handles the latter case:
>
> procedure weakMatch(r1,r2)
> return !r1 ~=== !r2
> end
If you want a bit more information about which items matched,
I think you can do something like
procedure indexMatch(l1, l2)
if l1[i:= 1 to *l1] === l2[j:= 1 to *l2]
then return [i, j]
end
(and if you wanted to allow for multiple matches, you could
change it to
suspend l1[i:= 1 to *l1] === l2[j:= 1 to *l2] & [i, j]
)
--
Iain Alexander PGP 1024-bit key id B501A0AD
ia@stryx.demon.co.uk I.Alexander@bsn0106.wins.icl.co.uk